home *** CD-ROM | disk | FTP | other *** search
/ MacGames Sampler / PHT MacGames Bundle.iso / MacSource Folder / Samples from the CD / C and C++ / Gnuplot 3.5 for Macintosh / SOURCES 3.5 / plot.h < prev    next >
Text File  |  1993-11-12  |  17KB  |  656 lines

  1. /*
  2.  * $Id: plot.h%v 3.50 1993/07/09 05:35:24 woo Exp $
  3.  *
  4.  */
  5.  
  6. /* GNUPLOT - plot.h */
  7. /*
  8.  * Copyright (C) 1986 - 1993   Thomas Williams, Colin Kelley
  9.  *
  10.  * Permission to use, copy, and distribute this software and its
  11.  * documentation for any purpose with or without fee is hereby granted, 
  12.  * provided that the above copyright notice appear in all copies and 
  13.  * that both that copyright notice and this permission notice appear 
  14.  * in supporting documentation.
  15.  *
  16.  * Permission to modify the software is granted, but not the right to
  17.  * distribute the modified code.  Modifications are to be distributed 
  18.  * as patches to released version.
  19.  *  
  20.  * This software is provided "as is" without express or implied warranty.
  21.  * 
  22.  *
  23.  * AUTHORS
  24.  * 
  25.  *   Original Software:
  26.  *     Thomas Williams,  Colin Kelley.
  27.  * 
  28.  *   Gnuplot 2.0 additions:
  29.  *       Russell Lang, Dave Kotz, John Campbell.
  30.  *
  31.  *   Gnuplot 3.0 additions:
  32.  *       Gershon Elber and many others.
  33.  * 
  34.  * There is a mailing list for gnuplot users. Note, however, that the
  35.  * newsgroup 
  36.  *    comp.graphics.gnuplot 
  37.  * is identical to the mailing list (they
  38.  * both carry the same set of messages). We prefer that you read the
  39.  * messages through that newsgroup, to subscribing to the mailing list.
  40.  * (If you can read that newsgroup, and are already on the mailing list,
  41.  * please send a message info-gnuplot-request@dartmouth.edu, asking to be
  42.  * removed from the mailing list.)
  43.  *
  44.  * The address for mailing to list members is
  45.  *       info-gnuplot@dartmouth.edu
  46.  * and for mailing administrative requests is 
  47.  *       info-gnuplot-request@dartmouth.edu
  48.  * The mailing list for bug reports is 
  49.  *       bug-gnuplot@dartmouth.edu
  50.  * The list of those interested in beta-test versions is
  51.  *       info-gnuplot-beta@dartmouth.edu
  52.  */
  53. #ifdef THINK_C
  54. #define macintosh 0
  55. #include <stdlib.h>
  56. char * alloc(size_t size, char *message);
  57. #define HELPFILE ":docs:gnuplot.gih" /* changed by makefile */
  58. #define TERM "TC_console"
  59. #endif
  60.  
  61. #define PROGRAM "G N U P L O T"
  62. #define PROMPT "gnuplot> "
  63. #if defined(AMIGA_SC_6_1) || defined(AMIGA_AC_5)
  64. #define SHELL "NewShell"
  65. #else /* AMIGA */
  66. #ifdef ATARI
  67. #define SHELL "gulam.prg"
  68. #else /* ATARI */
  69. #ifdef OS2
  70. #define SHELL "c:\\cmd.exe"
  71. #else /*OS2 */
  72. #define SHELL "/bin/sh"        /* used if SHELL env variable not set */
  73. #endif /*OS2 */
  74. #endif /* ATARI */
  75. #endif /* AMIGA  */
  76.  
  77. #if defined(__unix__) && !defined(unix)
  78. #define unix
  79. #endif
  80.  
  81. #define SAMPLES 100        /* default number of samples for a plot */
  82. #define ISO_SAMPLES 10        /* default number of isolines per splot */
  83. #define ZERO    1e-8        /* default for 'zero' set option */
  84.  
  85. #ifndef TERM
  86. /* default terminal is "unknown"; but see init_terminal */
  87. #define TERM "unknown"
  88. #endif
  89.  
  90. #define TRUE 1
  91. #define FALSE 0
  92.  
  93.  
  94. #define Pi 3.141592653589793
  95. #define DEG2RAD (Pi / 180.0)
  96.  
  97.  
  98. #define MIN_CRV_POINTS 100        /* minimum size of points[] in curve_points */
  99. #define MIN_SRF_POINTS 1000        /* minimum size of points[] in surface_points */
  100.  
  101. #ifdef THINK_C
  102.     #define MAX_LINE_LEN 1024    /* maximum number of chars allowed on line */
  103.     #define MAX_TOKENS 400
  104.     #define MAX_ID_LEN 50        /* max length of an identifier */
  105.     #define MAX_AT_LEN 150        /* max number of entries in action table */
  106.     #define STACK_DEPTH 13        
  107. #else
  108.     #define MAX_LINE_LEN 1024    /* maximum number of chars allowed on line */
  109.     #define MAX_TOKENS 400
  110.     #define MAX_ID_LEN 50        /* max length of an identifier */
  111.     
  112.     
  113.     #define MAX_AT_LEN 150        /* max number of entries in action table */
  114.     #define STACK_DEPTH 100
  115. #endif
  116.  
  117. #define NO_CARET (-1)
  118.  
  119. #ifdef MSDOS
  120. #define MAX_NUM_VAR    3    /* Ploting projection of func. of max. five vars. */
  121. #else
  122. #define MAX_NUM_VAR    5    /* Ploting projection of func. of max. five vars. */
  123. #endif
  124.  
  125. #define MAP3D_CARTESIAN        0    /* 3D Data mapping. */
  126. #define MAP3D_SPHERICAL        1
  127. #define MAP3D_CYLINDRICAL    2
  128.  
  129. #define CONTOUR_NONE    0    /* Where to place contour maps if at all. */
  130. #define CONTOUR_BASE    1
  131. #define CONTOUR_SRF    2
  132. #define CONTOUR_BOTH    3
  133.  
  134. #define CONTOUR_KIND_LINEAR    0 /* See contour.h in contours subdirectory. */
  135. #define CONTOUR_KIND_CUBIC_SPL    1
  136. #define CONTOUR_KIND_BSPLINE    2
  137.  
  138. #define LEVELS_AUTO            0        /* How contour levels are set */
  139. #define LEVELS_INCREMENTAL    1        /* user specified start & incremnet */
  140. #define LEVELS_DISCRETE        2        /* user specified discrete levels */
  141. #define MAX_DISCRETE_LEVELS   30
  142.  
  143. #define ANGLES_RADIANS    0
  144. #define ANGLES_DEGREES    1
  145.  
  146.  
  147. #if defined(AMIGA_SC_6_1) || defined(AMIGA_AC_5)
  148. #define OS "Amiga "
  149. #endif
  150.  
  151. #ifdef OS2
  152. #ifdef unix
  153. #undef unix    /* GCC might declare this */
  154. #define OS "OS/2"
  155. #endif
  156. #endif  /* OS2 */
  157.  
  158. #ifdef vms
  159. #define OS "VMS "
  160. #endif
  161.  
  162. #ifdef linux
  163. #define OS "Linux "
  164. #else
  165. #ifdef unix
  166. #define OS "unix "
  167. #endif
  168. #endif
  169.  
  170. #ifdef _WINDOWS
  171. #define _Windows
  172. #endif
  173.  
  174. #ifdef DOS386
  175. #define OS "DOS 386 "
  176. #endif
  177. #ifdef _Windows
  178. #define OS "MS-Windows "
  179. #else
  180. #ifdef MSDOS
  181. #ifdef unix    /* __EMX__ and DJGPP may set this */
  182. #undef OS
  183. #undef unix
  184. #endif
  185. #define OS "MS-DOS "
  186. #endif
  187. #endif
  188.  
  189. #ifdef THINK_C
  190. #define OS "Mac-OS (with THINK_C 5.0) "
  191. #endif
  192.  
  193. #ifdef ATARI
  194. #define OS "TOS "
  195. #endif
  196.  
  197. #ifndef OS
  198. #define OS ""
  199. #endif
  200.  
  201.  
  202. /* To access curves larger than 64k, MSDOS needs to use huge pointers */
  203. #if (defined(__TURBOC__) && defined(MSDOS)) || (defined(_Windows) && !defined(WIN32))
  204. #define GPHUGE huge
  205. #define GPFAR far
  206. #else
  207. #define GPHUGE
  208. #define GPFAR
  209. #endif
  210.  
  211.  
  212. /*
  213.  * Note about VERYLARGE:  This is the upper bound double (or float, if PC)
  214.  * numbers. This flag indicates very large numbers. It doesn't have to 
  215.  * be the absolutely biggest number on the machine.  
  216.  * If your machine doesn't have HUGE, or float.h,
  217.  * define VERYLARGE here. 
  218.  *
  219.  * This is a mess.  If someone figures out how to clean this up, please
  220.  *    diff -c  of your fixes
  221.  *
  222.  *
  223.  * example:
  224. #define VERYLARGE 1e37
  225.  */
  226.  
  227. #ifdef ATARI
  228. #include <stdlib.h>        /* Prototyping used !! 'size_t' */
  229. #include <stdio.h>
  230. #include <string.h>
  231. #include <math.h>
  232. #define VERYLARGE    HUGE_VAL
  233. #elif THINK_C
  234. #include <float.h>
  235. #define VERYLARGE DBL_MAX
  236. #define MEMCPY
  237. #undef NOCOPY
  238. #define NOGAMMA
  239. #define MEMSET
  240. #else  /* not ATARI and not Macintosh */
  241. #if defined(MSDOS) || defined(_Windows)
  242. #include <float.h>
  243. #define VERYLARGE (FLT_MAX/2 -1)
  244. #else  /* not MSDOS || _Windows */
  245. #if defined( vms ) || defined( _CRAY ) || defined( NEXT ) || defined(__osf__) || defined( OS2 ) || defined(__EMX__) || defined( DOS386) || defined(KSR)
  246. #include <float.h>
  247. #if defined ( NEXT )  /* bug in NeXT OS 2.0 */
  248. #if defined ( DBL_MAX)
  249. #undef DBL_MAX
  250. #endif
  251. #define DBL_MAX 1.7976931348623157e+308 
  252. #undef HUGE
  253. #define HUGE    DBL_MAX
  254. #undef HUGE_VAL
  255. #define HUGE_VAL DBL_MAX
  256. #endif /* not NEXT but CRAY, VMS or OSF */
  257. #define VERYLARGE (DBL_MAX/2 -1)
  258. #else  /* not vms, CRAY, NEXT, OS/2 or OSF */
  259. #ifdef AMIGA_AC_5
  260. #include <math.h>
  261. #define VERYLARGE (HUGE/2 -1)
  262. #else /* not AMIGA_AC_5 */
  263. #ifdef AMIGA_SC_6_1
  264. #include <float.h>
  265. #ifndef HUGE
  266. #define HUGE DBL_MAX
  267. #endif
  268. #define VERYLARGE (HUGE/2 -1)
  269. #else /* !AMIGA_SC_6_1 */
  270. /* #include <float.h> */
  271. #ifdef ISC22
  272. #include <float.h>
  273. #ifndef HUGE
  274. #define HUGE DBL_MAX
  275. #endif
  276. #endif /* ISC22 */
  277. /* This is the default */
  278. #ifndef HUGE
  279. #define HUGE DBL_MAX
  280. #endif
  281. #define VERYLARGE (HUGE/2 -1)
  282. /* default */
  283. #endif /* !AMIGA_SC_6_1 */
  284. #endif /* !AMIGA_AC_5 */
  285. #endif /* !VMS !CRAY !NEXT */
  286. #endif /* !MSDOS || !_Windows */
  287. #endif /* !ATARI */
  288.  
  289. #ifdef AMIGA_SC_6_1
  290. /* Get function prototypes */
  291. #include <stdio.h>
  292. #include <stdlib.h>
  293. #include <string.h>
  294. #include <math.h>
  295. #endif /* AMIGA_SC_6_1 */
  296.  
  297. #define END_OF_COMMAND (c_token >= num_tokens || equals(c_token,";"))
  298.  
  299. #ifdef vms
  300.  
  301.  
  302. #define is_comment(c) ((c) == '#' || (c) == '!')
  303. #define is_system(c) ((c) == '$')
  304.  
  305.  
  306. #else /* vms */
  307.  
  308. #define is_comment(c) ((c) == '#')
  309. #define is_system(c) ((c) == '!')
  310.  
  311. #endif /* vms */
  312.  
  313. /* If you don't have vfork, then undefine this */
  314. #if defined(NOVFORK) || defined(MSDOS) || defined( OS2 ) || defined(_Windows) || defined(DOS386)
  315. # undef VFORK
  316. #else
  317. # ifdef unix
  318. #  define VFORK
  319. # endif
  320. #endif
  321.  
  322. /* 
  323.  * memcpy() comes by many names. The default is now to assume bcopy, 
  324.  * since it is the most common case. Define 
  325.  *  MEMCPY to use memcpy(), 
  326.  *  vms to use the vms function,
  327.  *  NOCOPY to use a handwritten version in parse.c
  328.  */
  329. #ifdef vms
  330. # define memcpy(dest,src,len) lib$movc3(&len,src,dest)
  331. #else
  332. # if defined(MEMCPY) || defined(MSDOS) || defined (ATARI) || defined( OS2 ) || defined(_Windows) || defined(DOS386)
  333.    /* use memcpy directly */
  334. # else 
  335. #  ifdef NOCOPY
  336.     /* use the handwritten memcpy in parse.c */
  337. #  else
  338.     /* assume bcopy is in use */
  339. #   define memcpy(dest,src,len) bcopy(src,dest,len)
  340. #  endif /* NOCOPY */
  341. # endif /* MEMCPY || MSDOS */
  342. #endif /* vms */
  343.  
  344. /*
  345.  * In case you have MEMSET instead of BZERO. If you have something 
  346.  * else, define bzero to that something.
  347.  */
  348. #if defined(MEMSET) || defined(MSDOS) || defined( OS2 ) || defined(_Windows) || defined(DOS386)
  349. #define bzero(dest,len)  (void)(memset(dest, 0, len))
  350. #endif /* MEMSET || MSDOS */
  351.  
  352. #define top_of_stack stack[s_p]
  353.  
  354. typedef int TBOOLEAN;
  355.  
  356. #ifdef __ZTC__
  357. typedef int (*FUNC_PTR)(...);
  358. #else
  359. typedef int (*FUNC_PTR)();
  360. #endif
  361.  
  362. enum operators {
  363.     PUSH, PUSHC, PUSHD1, PUSHD2, PUSHD, CALL, CALLN, LNOT, BNOT, UMINUS,
  364.     LOR, LAND, BOR, XOR, BAND, EQ, NE, GT, LT, GE, LE, PLUS, MINUS, MULT,
  365.     DIV, MOD, POWER, FACTORIAL, BOOLE, JUMP, JUMPZ, JUMPNZ, JTERN, SF_START
  366. };
  367.  
  368.  
  369. #define is_jump(operator) ((operator) >=(int)JUMP && (operator) <(int)SF_START)
  370.  
  371.  
  372. enum DATA_TYPES {
  373.     INTGR, CMPLX
  374. };
  375.  
  376.  
  377. enum PLOT_TYPE {
  378.     FUNC, DATA, FUNC3D, DATA3D
  379. };
  380.  
  381. /*XXX - JG */
  382. enum PLOT_STYLE {
  383.     LINES, POINTSTYLE, IMPULSES, LINESPOINTS, DOTS, ERRORBARS, BOXES, BOXERROR, STEPS
  384. };
  385.  
  386. enum JUSTIFY {
  387.     LEFT, CENTRE, RIGHT
  388. };
  389.  
  390. #if !(defined(ATARI)&&defined(__GNUC__)&&defined(_MATH_H)) /* FF's math.h has the type already */
  391. struct cmplx {
  392.     double real, imag;
  393. };
  394. #endif
  395.  
  396.  
  397. struct value {
  398.     enum DATA_TYPES type;
  399.     union {
  400.         int int_val;
  401.         struct cmplx cmplx_val;
  402.     } v;
  403. };
  404.  
  405.  
  406. struct lexical_unit {    /* produced by scanner */
  407.     TBOOLEAN is_token;    /* true if token, false if a value */ 
  408.     struct value l_val;
  409.     int start_index;    /* index of first char in token */
  410.     int length;            /* length of token in chars */
  411. };
  412.  
  413.  
  414. struct ft_entry {        /* standard/internal function table entry */
  415.     char *f_name;        /* pointer to name of this function */
  416.     FUNC_PTR func;        /* address of function to call */
  417. };
  418.  
  419.  
  420. struct udft_entry {                /* user-defined function table entry */
  421.     struct udft_entry *next_udf;         /* pointer to next udf in linked list */
  422.     char udf_name[MAX_ID_LEN+1];         /* name of this function entry */
  423.     struct at_type *at;            /* pointer to action table to execute */
  424.     char *definition;             /* definition of function as typed */
  425.     struct value dummy_values[MAX_NUM_VAR];    /* current value of dummy variables */
  426. };
  427.  
  428.  
  429. struct udvt_entry {            /* user-defined value table entry */
  430.     struct udvt_entry *next_udv; /* pointer to next value in linked list */
  431.     char udv_name[MAX_ID_LEN+1]; /* name of this value entry */
  432.     TBOOLEAN udv_undef;        /* true if not defined yet */
  433.     struct value udv_value;    /* value it has */
  434. };
  435.  
  436.  
  437. union argument {            /* p-code argument */
  438.     int j_arg;                /* offset for jump */
  439.     struct value v_arg;        /* constant value */
  440.     struct udvt_entry *udv_arg;    /* pointer to dummy variable */
  441.     struct udft_entry *udf_arg; /* pointer to udf to execute */
  442. };
  443.  
  444.  
  445. struct at_entry {            /* action table entry */
  446.     enum operators index;    /* index of p-code function */
  447.     union argument arg;
  448. };
  449.  
  450.  
  451. struct at_type {
  452.     int a_count;                /* count of entries in .actions[] */
  453.     struct at_entry actions[MAX_AT_LEN];
  454.         /* will usually be less than MAX_AT_LEN is malloc()'d copy */
  455. };
  456.  
  457.  
  458. /* Defines the type of a coordinate */
  459. /* INRANGE and OUTRANGE points have an x,y point associated with them */
  460. enum coord_type {
  461.     INRANGE,                /* inside plot boundary */
  462.     OUTRANGE,                /* outside plot boundary, but defined */
  463.     UNDEFINED                /* not defined at all */
  464. };
  465.   
  466. #if defined(MSDOS) || defined(_Windows) 
  467. typedef float coordval;        /* memory is tight on PCs! */
  468. #else
  469. typedef double coordval;
  470. #endif
  471.  
  472. struct coordinate {
  473.     enum coord_type type;    /* see above */
  474.     coordval x, y, z;
  475.     coordval ylow, yhigh;    /* ignored in 3d */
  476. #if (defined(_Windows) && !defined(WIN32)) || (defined(MSDOS) && defined(__TURBOC__))
  477.     char pad[10];        /* pad to 32 byte boundary */
  478. #endif
  479. };
  480.  
  481. struct curve_points {
  482.     struct curve_points *next_cp;    /* pointer to next plot in linked list */
  483.     enum PLOT_TYPE plot_type;
  484.     enum PLOT_STYLE plot_style;
  485.     char *title;
  486.     int line_type;
  487.     int point_type;
  488.      int p_max;                    /* how many points are allocated */
  489.     int p_count;                    /* count of points in points */
  490.     struct coordinate GPHUGE *points;
  491. };
  492.  
  493. struct gnuplot_contours {
  494.     struct gnuplot_contours *next;
  495.     struct coordinate GPHUGE *coords;
  496.      char isNewLevel;
  497.      char label[12];
  498.     int num_pts;
  499. };
  500.  
  501. struct iso_curve {
  502.     struct iso_curve *next;
  503.      int p_max;                    /* how many points are allocated */
  504.     int p_count;                    /* count of points in points */
  505.     struct coordinate GPHUGE *points;
  506. };
  507.  
  508. struct surface_points {
  509.     struct surface_points *next_sp;    /* pointer to next plot in linked list */
  510.     enum PLOT_TYPE plot_type;
  511.     enum PLOT_STYLE plot_style;
  512.     char *title;
  513.     int line_type;
  514.     int point_type;
  515.     int has_grid_topology;
  516.     int num_iso_read;  /* Data files only - num of isolines read from file. */
  517.     struct gnuplot_contours *contours;    /* Not NULL If have contours. */
  518.     struct iso_curve *iso_crvs;
  519. };
  520.  
  521. struct TERMENTRY {
  522.     char *name;
  523. #if defined(_Windows) && !defined(WIN32)
  524.     char GPFAR description[80];    /* to make text go in FAR segment */
  525. #else
  526.     char *description;
  527. #endif
  528.     unsigned int xmax,ymax,v_char,h_char,v_tic,h_tic;
  529. #ifdef THINK_C
  530.     int (*options)(void);
  531.     int (*init)(void);
  532.     int (*reset)(void);
  533.     int (*text)(void);
  534.     FUNC_PTR scale;
  535.     int (*graphics)(void);
  536.     int (*move)(unsigned int, unsigned int);
  537.     int (*vector)(unsigned int, unsigned int);
  538.     int (*linetype)(int);
  539.     int (*put_text)(unsigned int, unsigned int, char *);
  540.     int (*text_angle)(int);
  541.     int (*justify_text)(enum JUSTIFY);
  542.     int (*point)(int, int, int);
  543.     int (*arrow)(int, int, int, int, TBOOLEAN);
  544. #else
  545.     FUNC_PTR options,init,reset,text,scale,graphics,move,vector,linetype,
  546.         put_text,text_angle,justify_text,point,arrow;
  547. #endif
  548. };
  549.  
  550. #ifdef _Windows
  551. #define termentry TERMENTRY far
  552. #else
  553. #define termentry TERMENTRY
  554. #endif
  555.  
  556.  
  557. struct text_label {
  558.     struct text_label *next;    /* pointer to next label in linked list */
  559.     int tag;            /* identifies the label */
  560.     double x,y,z;
  561.     enum JUSTIFY pos;
  562.     char text[MAX_LINE_LEN+1];
  563. };
  564.  
  565. struct arrow_def {
  566.     struct arrow_def *next;    /* pointer to next arrow in linked list */
  567.     int tag;            /* identifies the arrow */
  568.     double sx,sy,sz;        /* start position */
  569.     double ex,ey,ez;        /* end position */
  570.     TBOOLEAN head;            /* arrow has a head or not */
  571. };
  572.  
  573. /* Tic-mark labelling definition; see set xtics */
  574. struct ticdef {
  575.     int type;                /* one of three values below */
  576. #define TIC_COMPUTED 1        /* default; gnuplot figures them */
  577. #define TIC_SERIES 2        /* user-defined series */
  578. #define TIC_USER 3            /* user-defined points */
  579. #define TIC_MONTH 4        /* print out month names ((mo-1)%12)+1 */
  580. #define TIC_DAY 5        /* print out day of week */
  581.     union {
  582.        struct {            /* for TIC_SERIES */
  583.           double start, incr;
  584.           double end;        /* ymax, if VERYLARGE */
  585.        } series;
  586.        struct ticmark *user;    /* for TIC_USER */
  587.     } def;
  588. };
  589.  
  590. /* Defines one ticmark for TIC_USER style.
  591.  * If label==NULL, the value is printed with the usual format string.
  592.  * else, it is used as the format string (note that it may be a constant
  593.  * string, like "high" or "low").
  594.  */
  595. struct ticmark {
  596.     double position;        /* where on axis is this */
  597.     char *label;            /* optional (format) string label */
  598.     struct ticmark *next;    /* linked list */
  599. };
  600.  
  601. /*
  602.  * SS$_NORMAL is "normal completion", STS$M_INHIB_MSG supresses
  603.  
  604.  * printing a status message.
  605.  * SS$_ABORT is the general abort status code.
  606.  from:    Martin Minow
  607.     decvax!minow
  608.  */
  609. #ifdef    vms
  610. #include        <ssdef.h>
  611. #include        <stsdef.h>
  612. #define    IO_SUCCESS    (SS$_NORMAL | STS$M_INHIB_MSG)
  613. #define    IO_ERROR    SS$_ABORT
  614. #endif /* vms */
  615.  
  616.  
  617. #ifndef    IO_SUCCESS    /* DECUS or VMS C will have defined these already */
  618. #define    IO_SUCCESS    0
  619. #endif
  620. #ifndef    IO_ERROR
  621. #define    IO_ERROR    1
  622. #endif
  623.  
  624. /* Some key global variables */
  625. extern TBOOLEAN screen_ok;
  626. extern TBOOLEAN term_init;
  627. extern TBOOLEAN undefined;
  628. extern struct termentry term_tbl[];
  629.  
  630. #ifndef THINK_C
  631. extern char *alloc();
  632. extern char GPFAR *gpfaralloc();    /* far versions */
  633. extern char GPFAR *gpfarrealloc();
  634. extern void gpfarfree();
  635. #endif
  636. /* allocating and managing curve_points structures */
  637. extern struct curve_points *cp_alloc();
  638. extern int cp_extend();
  639. extern int cp_free();
  640. /* allocating and managing surface_points structures */
  641. extern struct surface_points *sp_alloc();
  642. extern int sp_replace();
  643. extern int sp_free();
  644. /* allocating and managing is_curve structures */
  645. extern struct iso_curve *iso_alloc();
  646. extern int iso_extend();
  647. extern int iso_free();
  648.  
  649. /* Windows needs to redefine stdin/stdout functions */
  650. #ifdef _Windows
  651. #include "win/wtext.h"
  652. #endif
  653.  
  654. #ifdef THINK_C
  655. typedef double transform_matrix[4][4];
  656. #endif